/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package scil.relatorios;

import java.sql.Connection;
import java.util.HashMap;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import scil.dados.Repositoriobd;
import scil.excecoes.ScilException;

/**
 *
 * @author jose junior
 */
public class GerarRelatorio extends Repositoriobd  {

    	public JasperPrint gerar(String codigo) throws JRException
        {
            JasperPrint rel = null;
            try {
               Connection con = getConnection() ;
                HashMap map = new HashMap();
                map.put("COD_CONTRATO", codigo);
                String arquivoJasper = "Contrato_grafica_1.jasper";
                rel = JasperFillManager.fillReport(arquivoJasper, map, con);
            } catch (JRException e)
            {
           //     JOptionPane.showMessageDialog(null,e.getMessage());
            }
            return rel;
        }

}
